package com.rxjava.simpleio;

public class Test {

	public static void main(String[] args) {
		Observable
        .create(new OnSubscribe<Integer>() {
            @Override
            public void call(Subscriber<? super Integer> subscriber) {
                System.out.println("create() " + Thread.currentThread());
                subscriber.onNext(3);
            }
        })
        .map(new Func1<Integer, String>() {
            @Override
            public String call(Integer integer) {
                System.out.println("map() " + Thread.currentThread());
                return "map" + integer;
            }
        })
        .subscribeOnIO()
        .subscribe(new Subscriber<String>() {
            @Override
            public void onNext(String s) {
                System.out.println("onNext() " + Thread.currentThread());
                System.out.println(s);
            }
        });

		System.out.println("-------------------------------------------------------------");
	}

}
